<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3种图表类型</title>
    <script src="./js/echarts.min.js"></script>
    <!-- 自定义主题要引入 -->
    <script src="./js/purple.js"></script>
    <style>
        /* div{
            color:#00eaff;
        } */
    </style>
</head>
<body>
    <div id="app" style="width:1200px;height:800px;border:1px solid #999"></div>
    <script>
        var lineColor = {
            type: 'linear',
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [{
                offset: 0, color: '#99f' // 0% 处的颜色
            }, {
                offset: 1, color: '#339' // 100% 处的颜色
            }],
            global: false // 缺省为 false
        }
        var lineColor2 = {
            type: 'linear',
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [{
                offset: 0, color: 'rgba(200,200,255,1)' // 0% 处的颜色
            }, {
                offset: 1, color: 'rgba(200,200,255,0)'  // 100% 处的颜色
            }],
            global: false // 缺省为 false
        }
        // dark light  自定义
        var myechart = echarts.init(document.getElementById("app"),"light")
        var option = {
            // backgroundColor:"#335",
            // color:["#9b8bba","#c663a5","#8fd3e8","#71669e","purple"],
            title:{
                text:"第一个文档",
                left:"center",
                top:30,
                subtext:'中国好chart',
                textStyle:{fontSize:28}
            },
            tooltip:{triger:"item"},
            legend:{
                data:["js",'vue',"html","css","jq","选择器"],
                left:'right'
            },
            xAxis:{
                data:["一期","二期","三阶段","四","五"]
            },
            yAxis:{},
            series:[
                {
                    name:'js',type:'bar',
                    data:[65,60,70,80,59],
                    itemStyle:{
                        borderRadius:[100,100,0,0],
                        color:lineColor                      
                    },
                    barWidth:40,
                },             
                {name:'css',type:'line',
                lineStyle:{
                    width:20,
                    color:"#00eaff",
                    cap:'round'
                },
                smooth:true,
                areaStyle:{color:lineColor2,opacity:1},
                data:[30,40,50,30,60]},
            ]
        }
        myechart.setOption(option);
        // type图表类型：
        // bar 柱状图
        // line 折线图  smmoth:true 曲线图   areaStyle 面积
        // pie 饼形图   radius:[100,50]  环形图
    </script>
</body>
</html>